<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
<title><?php echo C('WEB_SITE_TITLE');?></title>
<link href="/pan/Public/static/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="/pan/Public/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/pan/Public/static/bootstrap/css/docs.css" rel="stylesheet">
<link href="/pan/Public/static/bootstrap/css/onethink.css" rel="stylesheet">
<link href="/pan/Public/static/bootstrap/css/search.css" rel="stylesheet">

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="/pan/Public/static/bootstrap/js/html5shiv.js"></script>
<![endif]-->

<!--[if lt IE 9]>
<script type="text/javascript" src="/pan/Public/static/jquery-1.10.2.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script type="text/javascript" src="/pan/Public/static/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="/pan/Public/static/bootstrap/js/bootstrap.min.js"></script>
<!--<![endif]-->
<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->
<?php echo hook('pageHeader');?>

</head>
<body>
	<!-- 头部 -->
	<!-- 导航条
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="brand" href="<?php echo U('index/index');?>">聚宏数码店</a>
            <a class="brand" style="margin-left: 70%;" href="admin.php">后台登录</a>
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="nav-collapse collapse">
                <ul class="nav">
                    <?php $__NAV__ = M('Channel')->field(true)->where("status=1")->order("sort")->select(); if(is_array($__NAV__)): $i = 0; $__LIST__ = $__NAV__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i; if(($nav["pid"]) == "0"): ?><li>
                            <!--<a href="<?php echo (get_nav_url($nav["url"])); ?>" target="<?php if(($nav["target"]) == "1"): ?>_blank<?php else: ?>_self<?php endif; ?>"><?php echo ($nav["title"]); ?></a>-->
                        </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div>
            <!--<div class="nav-collapse collapse pull-right">
                <?php if(is_login()): ?><ul class="nav" style="margin-right:0">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="padding-left:0;padding-right:0"><?php echo get_username();?> <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="<?php echo U('User/profile');?>">修改密码</a></li>
                                <li><a href="<?php echo U('User/logout');?>">退出</a></li>
                            </ul>
                        </li>
                    </ul>
                <?php else: ?>
                    <ul class="nav" style="margin-right:0">
                        <li>
                            <a href="<?php echo U('User/login');?>">登录</a>
                        </li>
                        <li>
                            <a href="<?php echo U('User/register');?>" style="padding-left:0;padding-right:0">注册</a>
                        </li>
                    </ul><?php endif; ?>
            </div>-->
        </div>
    </div>
</div>

	<!-- /头部 -->
	
	<!-- 主体 -->
	
    <header class="jumbotron subhead" id="overview">
        <div class="container">
            <h2>源自相同起点，演绎不同精彩！</h2>
            <p class="lead"></p>
        </div>
    </header>

<div id="main-container" class="container">
    <div class="row">
        
<!-- 左侧 nav
================================================== -->
    <!--<div class="span3 bs-docs-sidebar">
        <ul class="nav nav-list bs-docs-sidenav">
            <?php echo W('Category/lists', array(39, true));?>
        </ul>
    </div>-->

        
    <div class="span9">
    </div>
    <div id="search_div">
        <div class="search_content">
            <div class="search_box">
                <input type="search" class="search_input" placeholder="请输入搜索内容,以便查询设备的维修信息！" value=""/>
            </div>
            <div class="search_select">
                <span data=""><a href="javascript:;" value="1">手机号码</a></span>
                <ul class="dropdown">
                    <li><a href="javascript:;" value="1">手机号码</a></li>
                    <li><a href="javascript:;" value="2">客户姓名</a></li>
                </ul>
            </div>
            <a href="javascript:;" class="search_btn">搜索</a>
        </div>
    </div>
    <div style="width: 100%;padding: 20px 20%;box-sizing: border-box;">
        <table class="table_info" width="100%" border="1">

        </table>
    </div>
    <script type="text/javascript">
        window.onload = function() {
            function DropDown(el) {
                this.dd = el;
                this.span = this.dd.children('span');
                this.li = this.dd.find('ul.dropdown li');
                this.val = '';
            }
            DropDown.prototype.initEvents = function() {
                var obj = this;
                obj.dd.on('click', function(event) {
                    $(this).toggleClass('active').siblings().removeClass('active');
                    event.stopPropagation();
                });
                obj.li.on('click', function() {
                    var opt = $(this);
                    obj.val = opt.html();
                    if(obj.span.html() == obj.val) return;
                    obj.span.html(obj.val);
                    $(document).click(function() {
                        $('.search_select').removeClass('active');
                    });
                })
            }
            var select = new DropDown($('.search_select'));
            select.initEvents();
        }
    </script>
    <script type="text/javascript">
        $("#search_select li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#search_select span").text(text).attr("data",$(this).attr("value"));
                $("#dropdown").addClass("hidden");
            })
        });
    </script>
    <script type="text/javascript">
        $(".search_btn").click(function(){
            var info = $(".search_input").val();
            var search_select = $(".search_select a").attr('value');
            $.ajax({
                url:"<?php echo U('Order/getRepairInfo');?>",
                type:"POST",
                data:{info:info,search_select:search_select},
                dataType:"json",
                success: function(result){
                    $(".table_info tr").remove();
                    var text = '';
                    if(result){
                        text += '<tr><th>客户姓名</th>';
                        text += '<th>'+result[0].customer+'</th></tr>';
                        text += '<tr><th>设备型号</th>';
                        text += '<th>'+result[0].repair_model+'</th></tr>';
                        text += '<tr><th>维修进程</th>';
                        text += '<th>'+result[0].repair_status+'</th></tr>';
                        text += '<tr><th>维修价格</th>';
                        text += '<th>'+result[0].repair_price+'</th></tr>';
                        text += '<tr><th>已付定金</th>';
                        text += '<th>'+result[0].repair_handsel+'</th></tr>';
                        text += '<tr><th>到店应付</th>';
                        text += '<th>'+(result[0].repair_price - result[0].repair_handsel)+'</th></tr>';
                    }else{
                        text = '<tr style="text-align: center;"><th>暂无维修设备信息！</th></tr>';
                    }
                    $(".table_info").append(text);
                },
                fail: function(){
                    console.log('信息接收失败！');
                }
            });
        });
    </script>

    </div>
</div>

<script type="text/javascript">
    $(function(){
        $(window).resize(function(){
            $("#main-container").css("min-height", $(window).height() - 343);
        }).resize();
    })
</script>
	<!-- /主体 -->

	<!-- 底部 -->
	
    <!-- 底部
    ================================================== -->
    <footer class="footer">
      <div class="container">
          <p> 本站由 <strong><a href="" target="_blank">聚宏数码店</a></strong> 支持</p>
      </div>
    </footer>

<script type="text/javascript">
(function(){
	var ThinkPHP = window.Think = {
		"ROOT"   : "/pan", //当前网站地址
		"APP"    : "/pan/index.php?s=", //当前项目地址
		"PUBLIC" : "/pan/Public", //项目公共目录地址
		"DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
		"MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
		"VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
	}
})();
</script>
 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
	
</div>

	<!-- /底部 -->
</body>
</html>